In commit
2c613166771ea9118ebda91c311f11b3462330fb we avoided emitting
the style-changed signal if no CSS property changed.
Unfortunately, this also caused CSS styles to not be updated when
animations started if those animations did not change any CSS value
immediately. In those cases the animation would just never start.
The obvious example was the spinner.
style_changed = gtk_css_style_change_has_change (&change);
if (style_changed)
- g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
+ {
+ g_signal_emit (cssnode, cssnode_signals[STYLE_CHANGED], 0, &change);
+ }
+ else if (cssnode->style != style &&
+ (GTK_IS_CSS_ANIMATED_STYLE (cssnode->style) || GTK_IS_CSS_ANIMATED_STYLE (style)))
+ {
+ /* This is when animations are starting/stopping but they didn't change any CSS this frame */
+ g_object_unref (cssnode->style);
+ cssnode->style = g_object_ref (style);
+ }
gtk_css_style_change_finish (&change);